package me.magicall.db.sql;

import me.magicall.tagInterfaces.HasName;

/**
 * 有名字的sql元素（父类）。如table、column、view等
 * 
 * @author MaGiCalL
 */
public class NamedElement extends SqlElementTemplate implements HasName {

	private String name;

	protected NamedElement() {
		this(null);
	}

	protected NamedElement(final String name) {
		super();
		setName(name);
	}

	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	@Override
	public StringBuilder appendTo(final StringBuilder sb) {
		return sb.append(" ").append(getName()).append(" ");
	}
}
